#ifndef _MFC_LRU_CACHE_DEFINE_H_
#define _MFC_LRU_CACHE_DEFINE_H_

// BITBAND 类型
#define MF_LRU_CACHE_SIZE           (1)     ///< 一项数据尺寸

#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#endif

#define MF_LRU_WHITE_LIST_COUNT     (4)     ///< 白名单数量
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagBitband
#define TMfLruCacheValue            TMfLruCacheValueBitband
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagBitband
#define TMfLruCacheKey              TMfLruCacheKeyBitband
#define TMfLruCacheDoRead           TMfLruCacheDoReadBitband
#define TMfLruCacheTag              TMfLruCacheTagBitband
#define TMfLruCache                 TMfLruCacheBitband
#define TMfLruCacheCreate           TMfLruCacheCreateBitband
#define TMfLruCacheDestroy          TMfLruCacheDestroyBitband
#define TMfLruCacheRead             TMfLruCacheReadBitband
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredBitband
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowBitband
#define Compare                     CompareBitband
#define SearchCache                 SearchCacheBitband
#define GetInvaildKeyIndex          GetInvaildKeyIndexBitband
#define AddAndGetCache              AddAndGetCacheBitband
#define GetCache                    GetCacheBitband
#define TryDeleteCache              TryDeleteCacheBitband
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyBitband
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowBitband
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllBitband
#include "mfc/mfc_lru_cache.h"

// BITBAND 类型
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll
/////////////////////
// BIT 类型
#define MF_LRU_CACHE_SIZE           (1)     ///< 一项数据尺寸
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#define MF_LRU_WHITE_LIST_COUNT     (4)     ///< 白名单数量
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagBit
#define TMfLruCacheValue            TMfLruCacheValueBit
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagBit
#define TMfLruCacheKey              TMfLruCacheKeyBit
#define TMfLruCacheDoRead           TMfLruCacheDoReadBit
#define TMfLruCacheTag              TMfLruCacheTagBit
#define TMfLruCache                 TMfLruCacheBit
#define TMfLruCacheCreate           TMfLruCacheCreateBit
#define TMfLruCacheDestroy          TMfLruCacheDestroyBit
#define TMfLruCacheRead             TMfLruCacheReadBit
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredBit
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowBit
#define Compare                     CompareBit
#define SearchCache                 SearchCacheBit
#define GetInvaildKeyIndex          GetInvaildKeyIndexBit
#define AddAndGetCache              AddAndGetCacheBit
#define GetCache                    GetCacheBit
#define TryDeleteCache              TryDeleteCacheBit
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyBit
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowBit
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllBit
#include "mfc_lru_cache.h"

// BIT 类型
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll
/////////////////
// BYTE 类型
#define MF_LRU_CACHE_SIZE           (1)     ///< 一项数据尺寸

#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#endif

#define MF_LRU_WHITE_LIST_COUNT     (4)     ///< 白名单数量
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagByte
#define TMfLruCacheValue            TMfLruCacheValueByte
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagByte
#define TMfLruCacheKey              TMfLruCacheKeyByte
#define TMfLruCacheDoRead           TMfLruCacheDoReadByte
#define TMfLruCacheTag              TMfLruCacheTagByte
#define TMfLruCache                 TMfLruCacheByte
#define TMfLruCacheCreate           TMfLruCacheCreateByte
#define TMfLruCacheDestroy          TMfLruCacheDestroyByte
#define TMfLruCacheRead             TMfLruCacheReadByte
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredByte
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowByte
#define Compare                     CompareByte
#define SearchCache                 SearchCacheByte
#define GetInvaildKeyIndex          GetInvaildKeyIndexByte
#define AddAndGetCache              AddAndGetCacheByte
#define GetCache                    GetCacheByte
#define TryDeleteCache              TryDeleteCacheByte
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyByte
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowByte
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllByte

#include "mfc/mfc_lru_cache.h"

// BYTE 类型
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll

// WORD 类型
#define MF_LRU_CACHE_SIZE           (2)
#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#endif
#define MF_LRU_WHITE_LIST_COUNT     (4)
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagWord
#define TMfLruCacheValue            TMfLruCacheValueWord
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagWord
#define TMfLruCacheKey              TMfLruCacheKeyWord
#define TMfLruCacheDoRead           TMfLruCacheDoReadWord
#define TMfLruCacheTag              TMfLruCacheTagWord
#define TMfLruCache                 TMfLruCacheWord
#define TMfLruCacheCreate           TMfLruCacheCreateWord
#define TMfLruCacheDestroy          TMfLruCacheDestroyWord
#define TMfLruCacheRead             TMfLruCacheReadWord
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredWord
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowWord
#define Compare                     CompareWord
#define SearchCache                 SearchCacheWord
#define GetInvaildKeyIndex          GetInvaildKeyIndexWord
#define AddAndGetCache              AddAndGetCacheWord
#define GetCache                    GetCacheWord
#define TryDeleteCache              TryDeleteCacheWord
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyWord
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowWord
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllWord
#include "mfc/mfc_lru_cache.h"

// WORD
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll

// DWORD
#define MF_LRU_CACHE_SIZE           (4)
#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#endif
#define MF_LRU_WHITE_LIST_COUNT     (4)
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagDWord
#define TMfLruCacheValue            TMfLruCacheValueDWord
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagDWord
#define TMfLruCacheKey              TMfLruCacheKeyDWord
#define TMfLruCacheDoRead           TMfLruCacheDoReadDWord
#define TMfLruCacheTag              TMfLruCacheTagDWord
#define TMfLruCache                 TMfLruCacheDWord
#define TMfLruCacheCreate           TMfLruCacheCreateDWord
#define TMfLruCacheDestroy          TMfLruCacheDestroyDWord
#define TMfLruCacheRead             TMfLruCacheReadDWord
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredDWord
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowDWord
#define Compare                     CompareDWord
#define SearchCache                 SearchCacheDWord
#define GetInvaildKeyIndex          GetInvaildKeyIndexDWord
#define AddAndGetCache              AddAndGetCacheDWord
#define GetCache                    GetCacheDWord
#define TryDeleteCache              TryDeleteCacheDWord
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyDWord
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowDWord
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllDWord
#include "mfc/mfc_lru_cache.h"

// DOWRD
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll

// QWORD
#define MF_LRU_CACHE_SIZE           (8)
#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (16)    ///< 可以缓冲的数据项数
#endif
#define MF_LRU_WHITE_LIST_COUNT     (4)
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagQWord
#define TMfLruCacheValue            TMfLruCacheValueQWord
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagQWord
#define TMfLruCacheKey              TMfLruCacheKeyQWord
#define TMfLruCacheDoRead           TMfLruCacheDoReadQWord
#define TMfLruCacheTag              TMfLruCacheTagQWord
#define TMfLruCache                 TMfLruCacheQWord
#define TMfLruCacheCreate           TMfLruCacheCreateQWord
#define TMfLruCacheDestroy          TMfLruCacheDestroyQWord
#define TMfLruCacheRead             TMfLruCacheReadQWord
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredQWord
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowQWord
#define Compare                     CompareQWord
#define SearchCache                 SearchCacheQWord
#define GetInvaildKeyIndex          GetInvaildKeyIndexQWord
#define AddAndGetCache              AddAndGetCacheQWord
#define GetCache                    GetCacheQWord
#define TryDeleteCache              TryDeleteCacheQWord
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyQWord
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowQWord
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllQWord
#include "mfc_lru_cache.h"

#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll

// MEM
#define MF_LRU_CACHE_SIZE           (64)
#ifdef __PLATFORM_S32K144__
#define MF_LRU_CACHE_COUNT          (1)    ///< 可以缓冲的数据项数
#else
#define MF_LRU_CACHE_COUNT          (6)    ///< 可以缓冲的数据项数
#endif
#define MF_LRU_WHITE_LIST_COUNT     (4)
#define MF_LRU_CACHE_INVAILD_KEY    (0xFFFFFFFF)

#define TMfLruCacheValueTag         TMfLruCacheValueTagMem
#define TMfLruCacheValue            TMfLruCacheValueMem
#define TMfLruCacheKeyTag           TMfLruCacheKeyTagMem
#define TMfLruCacheKey              TMfLruCacheKeyMem
#define TMfLruCacheDoRead           TMfLruCacheDoReadMem
#define TMfLruCacheTag              TMfLruCacheTagMem
#define TMfLruCache                 TMfLruCacheMem
#define TMfLruCacheCreate           TMfLruCacheCreateMem
#define TMfLruCacheDestroy          TMfLruCacheDestroyMem
#define TMfLruCacheRead             TMfLruCacheReadMem
#define TMfLruCacheDoExpired        TMfLruCacheDoExpiredMem
#define TMfLruCacheDoCheckAllow     TMfLruCacheDoCheckAllowMem
#define Compare                     CompareMem
#define SearchCache                 SearchCacheMem
#define GetInvaildKeyIndex          GetInvaildKeyIndexMem
#define AddAndGetCache              AddAndGetCacheMem
#define GetCache                    GetCacheMem
#define TryDeleteCache              TryDeleteCacheMem
#define TMfLruCacheInvaildKey       TMfLruCacheInvaildKeyMem
#define TMfLruCacheDoCheckDisallow  TMfLruCacheDoCheckDisallowMem
#define TMfLruCacheInvaildAll       TMfLruCacheInvaildAllMem

#include "mfc/mfc_lru_cache.h"

#if 0
#undef MF_LRU_CACHE_SIZE
#undef MF_LRU_CACHE_COUNT
#undef MF_LRU_WHITE_LIST_COUNT
#undef MF_LRU_CACHE_INVAILD_KEY

#undef TMfLruCacheValueTag
#undef TMfLruCacheValue
#undef TMfLruCacheKeyTag
#undef TMfLruCacheKey
#undef TMfLruCacheDoRead
#undef TMfLruCacheDoExpired
#undef TMfLruCacheTag
#undef TMfLruCache
#undef TMfLruCacheCreate
#undef TMfLruCacheDestroy
#undef TMfLruCacheRead
#undef TMfLruCacheDoCheckAllow
#undef Compare
#undef SearchCache
#undef GetInvaildKeyIndex
#undef AddAndGetCache
#undef GetCache
#undef TryDeleteCache
#undef TMfLruCacheInvaildKey
#undef TMfLruCacheDoCheckDisallow
#undef TMfLruCacheInvaildAll
#endif

#endif

